﻿using UnityEngine;
using System.Collections;
using UnityEngine.Networking;

public class BulletCollision : NetworkBehaviour {
	//[SyncVar]
	float attack;
	// Use this for initialization
	void Start () {
	
	}
	void OnTriggerEnter(Collider other){
		//Add isServer check to TakeDamage, so it will only be applied on the server
		if (!isServer)
			return;
		if (other.tag == "Player") {
			other.GetComponent<Attribute> ().changeHealth (-attack);
			Destroy (gameObject);
		}
	}
	/// <summary>
	/// Gets the data.
	/// </summary>
	/// <param name="getAttack">Get attack.</param>
	public void getData(float getAttack){
		attack = getAttack;
	}
}
